import {get, post} from '@/http/axios'

export default {
    namespaced: true,
    state: {
        // 数据列表
        dataList:[]
    },
    mutations: {
        // 根据突变修改dataList
        refreshQueryEpidemic(state,data) {
            state.dataList = data
        }
    },
    actions: {
        // 保存更新疫情信息
        async saveOrUpdateEpidemic({commit},params) {
            let response = await post("/epidemic/saveOrUpdate",params)
            return response;
        },
        // 分页查询所有疫情信息
        async queryEpidemic({commit},params) {
            let response = await get("epidemic/pageQuery",params)
            commit("refreshQueryEpidemic",response.data.data)
            return response
        }
    }
}